function f_delete_tmp_table()
{   #清理临时表
    declare _check_tools _check_db _check_table _check_ip _tmp_table exe_time_tmp _check_triggers get_res_trigger _reason_info fun_name delete_tri_mark
    declare -a _tmp_table_list _tmp_triggers_list
    fun_name="f_delete_tmp_table"
    _check_tools="${1}"
    _check_db="${2}"
    _check_table="${3}"
    _check_ip="${4}"
    _reason_info="${5}"
    if [ "${_check_tools}x" == "gh-ostx" ]
    then #定义清理ghost临时表sql
        _tmp_table_list[0]="drop table if exists _${_check_table}_del;"
        _tmp_table_list[1]="drop table if exists _${_check_table}_ghc;"
        _tmp_table_list[2]="drop table if exists _${_check_table}_gho;"
    elif [ "${_check_tools}x" == "pt-online-schema-changex" ]
    then #定义清理pt临时表及触发器的sql
        _check_triggers="select TRIGGER_NAME from ${isdbtr} where TRIGGER_SCHEMA = '${_check_db}' and EVENT_OBJECT_SCHEMA"
        _check_triggers="${_check_triggers} = '${_check_db}' and EVENT_OBJECT_TABLE = '${_check_table}' and TRIGGER_NAME like 'pt_osc_%';"
        get_res_trigger=($(f_exe_sql_in_mysql "${_check_triggers}" "${_check_ip}" "${mysql_port}" "slave" "$(eval echo ${log_addr})")) && exe_state="${?}" || exe_state="${?}"

        if [ -n "${get_res_trigger[0]}" ]
        then
            _tmp_triggers_list[0]="DROP TRIGGER IF EXISTS ${_check_db}.${get_res_trigger[0]};"
            _tmp_triggers_list[1]="DROP TRIGGER IF EXISTS ${_check_db}.${get_res_trigger[1]};"
            _tmp_triggers_list[2]="DROP TRIGGER IF EXISTS ${_check_db}.${get_res_trigger[2]};"
            f_logging "$(eval echo ${log_addr}):REMAIND" "${get_res_trigger[*]}" "1" "0" "0"
            delete_tri_mark="true"
        fi
        _tmp_table_list[0]="drop table if exists _${_check_table}_old;"
        _tmp_table_list[1]="drop table if exists _${_check_table}_new;"
    else
        return 0
    fi

    _tmp_table="${_tmp_table_list[@]}"
    exe_time_tmp="${exe_time}" #先保存超时时间10s, 因为清理临时表的时候加大执行时间, 执行完毕再还原
    exe_time="60s"

    f_logging "$(eval echo ${log_addr}):REMAIND" "准备清理临时表 '${_tmp_table}' ] [ ${_reason_info}" "1" "0" "0"
   
    if [ "${_check_tools}x" == "gh-ostx" ]
    then
        f_logging "$(eval echo ${log_addr}):REMAIND" "正在清理改表工具 '${_check_tools}' 生成的临时表 '${_tmp_table}'" "1" "0" "0"
        f_exe_sql_in_mysql "${_tmp_table}" "${_check_ip}" "${mysql_port}" "slave" "$(eval echo ${log_addr})" && exe_state="${?}" || exe_state="${?}"
    elif [ "${_check_tools}x" == "pt-online-schema-changex" ]
    then

        if [ "${delete_tri_mark}x" == "truex" ]
        then
            f_logging "$(eval echo ${log_addr}):REMAIND" "正在清理改表工具 '${_check_tools}' 生成的触发器 '${_tmp_triggers_list[*]}'" "1" "0" "0"
            _tmp_triggers="${_tmp_triggers_list[@]}"
            f_exe_sql_in_mysql "${_tmp_triggers}" "${_check_ip}" "${mysql_port}" "slave" "$(eval echo ${log_addr})" && exe_state="${?}" || exe_state="${?}"
        else
            f_logging "$(eval echo ${log_addr}):WARN" "改表工具 '${_check_tools}' 生成的触发器已经被工具清理, 不用重复清理" "1" "0" "0"
        fi
        unset _tmp_triggers_list
        _check_triggers="select count(*) from ${isdbtr} where TRIGGER_SCHEMA = '${_check_db}' and EVENT_OBJECT_SCHEMA"
        _check_triggers="${_check_triggers} = '${_check_db}' and EVENT_OBJECT_TABLE = '${_check_table}' and TRIGGER_NAME like 'pt_osc_%';"
        get_res_trigger="$(f_exe_sql_in_mysql "${_check_triggers}" "${_check_ip}" "${mysql_port}" "slave" "$(eval echo ${log_addr})")" && exe_state="${?}" || exe_state="${?}"

        if [ ${exe_state} -eq 0 ] && [ "${get_res_trigger}x" == "0x" ]
        then
            f_logging "$(eval echo ${log_addr}):REMAIND" "正在清理改表工具 '${_check_tools}' 生成的临时表 '${_tmp_table}'" "1" "0" "0"
            f_exe_sql_in_mysql "${_tmp_table}" "${_check_ip}" "${mysql_port}" "slave" "$(eval echo ${log_addr})" && exe_state="${?}" || exe_state="${?}"
        else
            f_logging "$(eval echo ${log_addr}):ERROR" "改表工具 '${_check_tools}' 生成的触发器 '${_tmp_triggers}' 清理失败" "2" "1" "0" "0"
            exe_state=1
        fi
    fi

    exe_time="${exe_time_tmp}"
    if [ ${exe_state} -eq 0 ]
    then
        f_logging "$(eval echo ${log_addr}):INFO" "改表工具 '${_check_tools}' 生成的临时表 '${_tmp_table}' 清理成功" "1" "0" "0"
    else
        f_logging "$(eval echo ${log_addr}):ERROR" "改表工具 '${_check_tools}' 生成的临时表 '${_tmp_table}' 清理失败" "2" "0" "0"
    fi

    return ${exe_state}
}

